-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail travis on non updated files #5003
Conversation
This commit is expected to fail, as the library code has been modified, but the task was explicitly not run and files are not added.
This commit is supposed to succeed passed the before_script stage on Travis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Seems like a good simple way to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but can you also add the closure externs?
.travis.yml
Outdated
@@ -12,6 +12,8 @@ before_script: | |||
- npm install -g bower gulp-cli@1 | |||
- bower install | |||
- gulp lint-eslint | |||
- gulp generate-typescript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add gulp generate-externs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍 Edited on GitHub, so let's see if Travis complains
In #4928 we added support for TypeScript by auto-generating types based on the Closure types defined in the library. However, we have to remember that whenever we update our types, that we also regenerate these TypeScript types.
I browsed the man pages of
git diff
and came acrossgit diff --exit-code
: https://git-scm.com/docs/git-diff#git-diff---exit-code This makesgit diff
fail whenever there are changes.As such, this PR introduces the
git diff
in thebefore_script
stage on Travis. This task now runs the generation script of TypeScript types and then verifies that there are no uncommitted changes. Whenever someone updates any Closure types (or adds them with new features), the Travis build will now fail if the developer forgot to update the TypeScript types.In the commit history of this PR, you can see that the 2nd commit intentionally failed, by updating 1 of our types and not committing the corresponding TypeScript
d.ts
updates.